﻿package Message.Public
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import flash.utils.*;

    public class SBusinessInfo extends IMessageBase
    {
        public var entityId:SEntityId;
        public var status:EBusinessStatus;
        public var name:String;
        public var level:int;
        public var camp:int;
        public var coin:int;
        public var gold:int;
        public var items:Dictionary;
        public const _type:int = 13501;
        public static var _regist:SBusinessInfo = new SBusinessInfo(true);

        public function SBusinessInfo(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SBusinessInfo();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            this.entityId.__write(param1);
            this.status.__write(param1);
            param1.writeString(this.name);
            param1.writeByte(this.level);
            param1.writeByte(this.camp);
            param1.writeInt(this.coin);
            param1.writeInt(this.gold);
            DictBusinessItemUpdateHelper.write(param1, this.items);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.entityId = new SEntityId();
            this.entityId.__read(param1);
            this.status = EBusinessStatus.__read(param1);
            this.name = param1.readString();
            this.level = param1.readByte();
            this.camp = param1.readByte();
            this.coin = param1.readInt();
            this.gold = param1.readInt();
            this.items = DictBusinessItemUpdateHelper.read(param1);
            return;
        }// end function

    }
}
